package client;

import gui.ClientContext;
import gui.ExamFrame;
import gui.LoginFrame;
import gui.MenuFrame;
import gui.WelcomeWindow;
import service.ExamServiceAgentImpl;
import dao.Config;
 

public class ClientMain {
  public static void main(String[] args) {
    
    try{
      Config config = 
        new Config("client.properties");
      ExamServiceAgentImpl service = 
        new ExamServiceAgentImpl(config);
      ClientContext context = 
        new ClientContext(service);
      LoginFrame loginFrame = 
        new LoginFrame(context);
      MenuFrame menuFrame = 
        new MenuFrame(context);
      ExamFrame examFrame = new ExamFrame(context);
      WelcomeWindow window = new WelcomeWindow();
      
      context.setLoginFrame(loginFrame);
      context.setMenuFrame(menuFrame);
      context.setExamFrame(examFrame);
      context.setWindow(window);
      
      context.showWelcome();

    }catch(Exception e){
      e.printStackTrace();
    }
  }

}
